package com.example.demo.mapper;

import com.example.demo.pojo.Clazz;
import com.example.demo.pojo.ClazzQueryParam;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ClazzMapper {

    Page<Clazz> list(ClazzQueryParam clazzQueryParam);
    @Delete("delete from clazz where id =#{id}")
    void delete(Integer id);
    @Insert("insert into clazz ( name, room, begin_date, end_date, master_id, subject, create_time, update_time) values (#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime})")
    void save(Clazz clazz);
    @Select("select *from clazz where id=#{id}")
    Clazz find(Integer id);
    @Update("update  clazz set name=#{name},room=#{room},begin_date=#{beginDate},end_date=#{endDate},update_time=#{updateTime},master_id = #{masterId},subject#{subject}")
    void update(Clazz clazz);
    @Select("select *from clazz")
    List<Clazz> findall();
}
